import { SUN_INTENSITY_DEFAULT } from "@/constants/const";
import { DirectionalLight } from "three";

class MySunLight {
  mesh: DirectionalLight;
  constructor() {
    this.mesh = new DirectionalLight(0xffffff, SUN_INTENSITY_DEFAULT);
  }
  init() {
    this.mesh.position.set(2300, 1500, 800);
    this.mesh.lookAt(0, 0, 0);
    this.mesh.castShadow = true;
    //Set up shadow properties for the light
    this.mesh.shadow.mapSize.width = 5000;
    this.mesh.shadow.mapSize.height = 5000;
    this.mesh.shadow.camera.near = 0.5;
    this.mesh.shadow.camera.far = 5000;

    this.mesh.shadow.camera.top = 3000;
    this.mesh.shadow.camera.right = 3000;
    this.mesh.shadow.camera.bottom = -1500;
    this.mesh.shadow.camera.left = -3000;
  }
}
export const sunlight = new MySunLight();

